<template>
  <div class="container">
   <SkuList v-model="skuList" @submit="submit"></SkuList>
  </div>
</template>

<script>
import SkuList from '@/components/skuList.vue'
export default {
  name: "addSkuList",
  components:{
    SkuList
  },
  data() {
    return {
      skuList: [],
    };
  },
  created() {
    this.skuList = JSON.parse(sessionStorage.getItem("formData")).form.hgProductSkus;
  },
  methods: {
    submit() {
      const formData = JSON.parse(sessionStorage.getItem("formData"));
      formData.form.hgProductSkus = this.skuList;
      sessionStorage.setItem("formData", JSON.stringify(formData));
      sessionStorage.setItem('isSkuBack', 1)
      this.$router.back();
    },
  },
};
</script>

<style lang="scss" scoped>
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 1200px;
  min-height: 717px;
  margin: 0 auto 30px;
  background: #fff;
}
</style>
